home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1986 July
/
Ahoy_Magazine_86-07_1986_Double_L.d64
/
music school
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
9KB
|
218 lines
5 rem"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
6 rem"[194] fidgits music school [194]"
7 rem"[194] by walter e. meyers [194]"
8 rem"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
10 poke 56576,peek(56576)or 3:poke 53272,21:poke 648,4:poke 53269,0:goto 1000
20 poke s+1,hi:poke s,lo:poke s+4,17:for t=1 to 100:next:poke s+4,16:return
30 poke 198,0:wait 198,1:ii=peek(631):poke 198,0:return
50 poke 781,ln:poke 782,col:poke 783,0:sys 65520:return
60 for c=54272 to 54296:poke c,0:next:return
90 n=int(rnd(0)*d)+1:return
98 :
99 rem title page
100 gosub 60:for i=5 to 20 step 7:poke s+i,0:poke s+i+1,240:next:poke s+24,15
110 print"[147]":for i=1 to 6:print:next:for j=1 to 3:for i=1 to 4
120 print f$(i) spc(18) f$(i);:next:next:ln=11:col=18:gosub 50:print b7$:m=1
130 ll=8:n=12:for i=1 to 30:ln=6:col=18:gosub 50:print m$(m):ln=ll:col=12
140 gosub 50:print wl$:col=23:gosub 50:print wr$:d=18:gosub 90:hi=hi(n)
150 lo=lo(n):gosub 20:ll=abs(17-ll):m=abs(3-m):next:for t=1 to 100:next
158 :
159 rem instructions
160 print"[147]":for i=1 to 4:print f$(i) spc(18) f$(i);:next:print
170 print"[151] fidgits can help you learn to read music. you will see so";
180 print"me notes on a staff, with a fidgit under each one. hit the ";
190 print"key that has the name of the note on it. when all your notes a";
200 print"re right, the fidgits will spell a word hidden in the music."
208 :
209 rem load font
210 poke 56334,peek(56334) and 254:poke 1,peek(1) and 251:sys 49152
220 poke 1,peek(1) or 4:poke 56334,peek(56334) or 1
230 read k:if k=999 then 250
240 for j=0 to 7:read i:poke 61440+(k*8)+j,i:next:goto 230
250 print" [152] hit any key when ready to continue.":gosub 30
260 poke 56576,peek(56576) and 252:poke 53272,44:poke 648,200
298 :
299 rem get clef
300 poke v+23,3:poke v+29,3:poke v+39,0:poke v+40,0:poke v,100:poke v+1,120
305 poke v+2,220:poke v+3,120:poke 52216,1:poke 52217,2:print"[147]"
310 print tab(15)"[144]pick one:":poke v+21,3:ln=15:col=0:gosub 50:print b8$
320 gosub 30:if ii<70 or ii>71 then 320
330 poke v+21,0:poke v+23,1:poke v+29,1:poke v,28:poke v+2,60:poke 52217,3
340 game=0:sa=0:cl=7:ca=14:if ii=70 then poke 52216,2:cl=0:sa=-20:ca=0:wrd=0
348 :
349 rem main loop
350 print"[147]":poke s+24,15:for i=0 to 5:print tab(5) kb$(i):next:print:print
360 for i=0 to 4:print cl$(i):next:poke v+21,1:ln=15:col=4
400 if wrd=40 then for i=1 to 51:w(i)=0:next
405 j=3:p=2:d=51:gosub 90:if w(n)=1 then 405
410 l=len(w$(n)):w(n)=1:wrd=wrd+1:for i=1 to l:p$=mid$(w$(n),i,1)
415 poke 52216+i,3:on asc(p$)-64 goto 420,430,480,450,460,470,440
420 y=128:no=6:lc(i)=16:goto 490:rem a
430 y=124:no=7:lc(i)=18:goto 490:rem b
440 y=132:no=5:lc(i)=14:goto 490:rem g
450 y=144:no=2:lc(i)=8:goto 490:rem d
460 y=140:no=3:lc(i)=10:goto 490:rem e
470 y=136:no=4:lc(i)=12:goto 490:rem f
480 y=148:no=1:lc(i)=6:if cl=7 then poke 52216+i,4:rem middle c
490 y=y+sa:no=no+cl:lc(i)=lc(i)+ca
500 poke v+39+i,2:poke v+j,y:poke v+21,peek(v+21)+p:gosub 50:print ho$:ln=20
510 gosub 50:print""b$(0):hi=hi(no):lo=lo(no):gosub 20:ln=15:gosub 50:n1(i)=no
520 print hc$:poke v+39+i,0:col=col+4:j=j+2:p=p*2:nh(i)=hi:nl(i)=lo:next:ln=20
530 col=4:for i=1 to l:p$=mid$(w$(n),i,1):gosub 50:print"" b$(0):poke v+39+i,2
540 gosub 30:j=ii
550 if chr$(j)<>p$ then poke v+39+i,1:ln=15:gosub 50:print hs$:goto 540
560 ln=20:gosub 50:print b$(j-64):ln=15:gosub 50:print ho$:hi=nh(i):lo=nl(i)
570 gosub 20:gosub 50:print hc$:c1=col+4:ln=5:col=lc(i):gosub 50:print"[144]" p$
580 ln=20:col=c1:next:ln=15:col=4
598 :
599 rem show off
600 for i=1 to l:gosub 50:print ho$:poke s+1,hi(n1(i)):poke s,lo(n1(i))
610 poke s+8,hi(n1(i)+3):poke s+7,lo(n1(i)+3):poke s+15,hi(n1(i)+5)
620 poke s+14,lo(n1(i)+5):poke s+4,17:poke s+11,17:poke s+18,17:for t=1 to 300
630 next:gosub 50:poke s+4,16:poke s+11,16:poke s+18,16:print hc$:col=col+4
640 next:c1=col:ln=8:col=14:gosub 50:print"[152]hit any key":gosub 30:col=c1
650 game=game+1:if game<7 then 350
698 :
699 rem new/end game
700 poke v+21,0:poke s+24,0:gosub 900:gosub 950:gosub 30:if ii<>81 then 300
710 gosub 900:print:gosub 980:ln=3:col=13:for i=1 to 21:gosub 50:print wl$
720 for t=1 to 100:next:ln=abs(5-ln):next:poke 53272,21:poke 648,4
730 poke 56576,peek(56576) or 3:print"[147][154]":poke sc,6:poke bo,14:new:end
898 :
899 rem nest sbrtn
900 print"[147]":printtab(18) b1$:printtab(18) b2$:printtab(16) left$(ne$,3);
910 print b3$ left$(ne$,3):printtab(13) left$(ne$,6) b4$ left$(ne$,6)
920 printtab(11) left$(ne$,6)"[146]" b5$ left$(ne$,6):printtab(10) left$(ne$,4);
930 print "[146]" b6$ left$(ne$,4):printtab(8) ne$:printtab(9) left$(ne$,22)
940 printtab(10) left$(ne$,20):printtab(11) left$(ne$,18):return
948 :
949 rem banner sbrtns
950 printtab(9)" [176][201][193] [213][201][193][193] [213][201][213][201][213][201][193][176][201][213][201] ":printtab(9)" [171][203][194] [171][179][202][179] [171][179][194][174][171][179][194][194][194][213][203] "
960 printtab(9)" [216] [173][211][216][216] [216] [216][216][202][203][216][216][216][216][216][209] ":print tab(9)"[151]hit[182]q[146][181]to quit or any"
970 printtab(9)"other key to play again.":return
980 printtab(11)" [213][201][213][201] [193] [213][201][176][201][213][201] [193] ":printtab(11)" [202][201][194][194] [194] [194][194][194][194][194][174] [194] "
990 printtab(11)" [202][203][202][203] [173][211][202][203][216][216][202][203] [209] ":return
998 :
999 rem initialize
1000 print"[147][144]one moment, please.":poke 53281,15:poke 53280,15:s=54272
1010 x=rnd(-ti):dim b$(7),hi(19),lo(19),nh(19),nl(19),f$(4),m$(2),w$(52),w(52)
1020 for type=49152 to 49184:read a:poke type,a:next
1030 for sprite=49216 to 49471:read a:poke sprite,a:next
1040 for wrd=1 to 51:read a$:w$(wrd)=a$:next
1050 for music=1 to 18:read a:hi(mu)=int(a/256):lo(mu)=a-(hi(mu)*256):next
1060 v=53248:poke v+23,3:poke v+29,3:poke v+39,0:poke v+40,0:poke v,100
1070 poke v+1,120:poke v+2,220:poke v+3,120:poke 52216,1:poke 52217,2:h=92
1080 for i=v+4 to v+14 step 2:poke i,h:h=h+32:next
1098 :
1099 rem strings
1100 hc$=" [157][157][157][157][213][195][195][201][157][157][157][157][194][144]**[146][194][157][157][157][157][194][129]$%[146][194][157][157][157][157][202][178][178][203][157][157][157][157]"
1110 ho$="[213][195][195][201][157][157][157][157][194][169][223][146][194][157][157][157][157][194][223][169][194][157][157][157][157][202][178][178][203][157][157][157][157] [221][221] "
1120 hs$=" [157][157][157][157]/[146][175][175]0[157][157][157][157]1[144]223[157][157][157][157]4[129]$%5[157][157][157][157][146][202][178][178][203][157][157][157][157]"
1130 b$(0)="& '[157][157][157][157] [167][157][157][157][157] [167]":b$(1)="[152]&[213][201]'[157][157][157][157] [171][179] [157][157][157][157] [216][216] "
1140 b$(2)="&[176][201]'[157][157][157][157] [171][218] [157][157][157][157] [173][203] ":b$(3)="[156]&[213][201]'[157][157][157][157] [194] [157][157][157][157] [202][203] "
1150 b$(4)="&[176][201]'[157][157][157][157] [194][194] [157][157][157][157] [173][203] ":b$(5)="[129]&[176][211]'[157][157][157][157] [171][211] [157][157][157][157] [173][211] "
1160 b$(6)="[154]&[176][211]'[157][157][157][157] [171][211] [157][157][157][157] [216] ":b$(7)="[144]&[213][201]'[157][157][157][157] [194][174] [157][157][157][157] [202][203] "
1170 b1$="[213][192][192][201]":b2$="[194][144]**[146][194][149]":b3$="[146][194][129]$%[146][194][149]":b4$="[146][202][178][178][203][149]"
1180 b5$=" & '[146][149] ":b6$=" [146][149] "
1190 b7$="[169] [223][157][157][157][157] [157][157][157][157] ":ne$="())((())()())()())()(())"
1200 b8$="[152]press [144]g [152]or [144]f"
1210 wl$=" [157][157][157][157][157][176][192][192][192][201][157][157][157][157][157][202][178] [194][157][157][157][157][202][178] [173][157][157][157][202][192][192][157][157][157] "
1220 wr$=" [157][157][157][157][157][213][192][192][192][174][157][157][157][157][157][194] [178][203][157][157][157][157][157][189] [178][203][157][157][157][157][192][192][203][157][157][157] [151]"
1230 f$(1)="[213][201][211] [174] [211] ":f$(2)="[219] [174][213][179][213][174][174][219][213][201]":f$(3)="[177] [177][202][177][202][179][177][202][202][201]"
1240 f$(4)=" [202][203] [202][203]":m$(2)="[129][223][146] [169][157][157][157][157][157][146][213][129] [223][169] [146][201]"
1250 m$(1)="[129] [169][223][146] [157][157][157][157][157][213][129][169] [223][146][201][157][157][157][157][157][157][194] [144][209] [194][157][157][157][157][157][157][194] [194][157][157][157][157][157][157][202][192][174][176][192][203]"
1300 c1$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":c2$="[151][176]":c3$="[171]":c4$="[173]"
1310 cl$(0)=c2$+c1$:cl$(1)=c3$+c1$:cl$(2)=cl$(1):cl$(3)=cl$(1):cl$(4)=c4$+c1$
1320 kb$(0)="[221] [144] [144] [221] [144] [144] [144] [221] [144] [144] [221] [144] [144] [144] [221]"
1330 kb$(1)=kb$(0):kb$(2)=kb$(0):kb$(3)="[221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221]"
1340 kb$(4)=kb$(3):kb$(5)="[219][162][219][162][219][162][219][162][219][162][219][162][219][162][219][162][219][162][219][162][219][162][219][162][219][162][219][162][219]"
1990 goto 100
1999 :
2199 rem copy font
2200 data 169,0,133,251,133,253,169,208
2210 data 133,252,169,240,133,254,162
2220 data 16,160,0,177,251,145,253,136
2230 data 208,249,230,252,230,254,202
2240 data 208,240,96
2298 :
2299 rem g clef sprite
2300 data 0,64,0,0,240,0,0,216,0
2310 data 0,204,0,0,204,0,0,216,0
2320 data 0,240,0,0,224,0,1,192,0
2330 data 3,192,0,6,192,0,12,192,0
2340 data 27,240,0,54,216,0,108,204,0
2350 data 108,204,0,54,216,0,24,240,0
2360 data 15,224,0,0,192,0,1,128,0,0
2398 :
2399 rem f clef sprite
2400 data 0,0,0,0,0,0,0,0,0
2410 data 15,0,0,25,140,0,48,204,0
2420 data 54,96,0,28,96,0,0,108,0
2430 data 0,108,0,0,96,0,0,96,0
2440 data 0,192,0,1,128,0,3,0,0
2450 data 6,0,0,0,0,0,0,0,0
2460 data 0,0,0,0,0,0,0,0,0,0
2498 :
2499 rem note sprite
2500 data 0,0,0,0,0,0,0,0,0
2510 data 0,0,0,0,0,0,0,0,0
2520 data 0,0,0,0,0,0,0,0,0
2530 data 0,0,0,0,0,0,0,0,0
2540 data 0,0,0,0,0,0,0,0,0
2550 data 1,255,128,7,255,224,15,255,248
2560 data 15,255,248,7,255,224,1,255,128,0
2598 :
2599 rem middle c
2600 data 0,0,0,0,0,0,0,0,0
2610 data 0,0,0,0,0,0,0,0,0
2620 data 0,0,0,0,0,0,0,0,0
2630 data 0,0,0,0,0,0,0,0,0
2640 data 0,0,0,0,0,0,0,0,0
2650 data 1,255,128,7,255,224,255,255,255
2660 data 255,255,255,7,255,224,1,255,128,0
2698 :
2699 rem words
2700 data"abed","accede","ace","add","age","aged"
2710 data"babe","bad","bag","baggage","bead","beaded","bed","bedded","bee"
2720 data"cab","cage","caged","cafe","cabbage","cad","cede","ceded"
2730 data"dab","dad","decade","dead","deed","deface","defaced","deaf"
2740 data"ebb","edge","edged","efface","effaced","egg","egged"
2750 data"facade","face","faced","fade","faded","fad","fed","fee","feed"
2760 data"gab","gaff","gag","gee"
2798 :
2799 rem note frequencies
2800 data 2145,2408,2703,2864,3215,3608,4050,4291,4817,5407,5728,6430,7217
2810 data 8101,8583,9634,10814,11457
3098 :
3099 rem custom font data
3164 data164,63,113,57,31,15,7,3,1
3165 data165,252,142,156,248,240,224,192,128
3166 data166,15,15,7,15,31,63,127,255
3167 data167,240,240,224,240,248,252,254,255
3168 data168,49,155,206,236,63,115,206,72
3169 data169,140,217,115,55,252,206,115,18
3170 data170,126,231,0,60,126,60,0,0
3175 data175,0,0,0,0,0,0,7,15
3176 data176,0,0,0,0,0,0,224,240
3177 data177,28,24,24,12,12,24,48,48
3178 data178,60,102,195,24,60,60,60,24
3179 data179,56,24,24,48,48,24,12,12
3180 data180,24,28,14,7,7,14,28,24
3181 data181,24,56,112,224,224,112,56,24
3193 data193,255,255,255,195,195,195,195,195
3194 data194,195,195,195,195,195,195,195,195
3201 data201,255,255,255,15,7,131,195,195
3202 data202,195,195,193,224,240,255,255,255
3203 data203,195,195,131,7,15,255,255,255
3211 data211,255,255,255,3,3,255,255,255
3213 data213,255,255,255,240,224,193,195,195
3216 data216,195,195,195,195,195,255,255,255
3218 data218,195,195,135,15,15,135,195,195
3219 data219,231,231,195,0,0,0,0,0
3235 data235,195,195,195,192,192,195,195,195
3237 data237,195,195,195,192,192,255,255,255
3238 data238,255,255,255,3,3,195,195,195
3240 data240,255,255,255,192,192,195,195,195
3243 data243,195,195,195,3,3,195,195,195
3999 data 999